@using Demo.Models;
@model ProductInfo;

<head>
    <style>
        table,
        td,
        th {
            border: 1px solid;
        }
    </style>
</head>

<body>
    <table>
        @if (Model == null)
        {
            <tr hidden>
                <td>ID:</td>
                <td><input name="Id" type="text" value="0"></td>
            </tr>
            <tr>
                <td>商品名称:</td>
                <td><input name="NewName" type="text"></td>
            </tr>
            <tr>
                <td>供应商名称:</td>
                <td><input name="NewSupplier" type="text"></td>
            </tr>
            <tr>
                <td>价格:</td>
                <td><input name="NewPrice" type="text"></td>
            </tr>
            <tr>
                <td>库存数量:</td>
                <td><input name="NewStock" type="text"></td>
            </tr>
            <tr>
                <td>备注:</td>
                <td><input name="NewRemarks" type="text"></td>
            </tr>
        }
        else
        {
            <tr hidden>
                <td>ID:</td>
                <td><input name="Id" type="text" value="@Model.Id"></td>
            </tr>
            <tr>
                <td>商品名称:</td>
                <td><input name="NewName" type="text" value="@Model.ProductName"></td>
            </tr>
            <tr>
                <td>供应商名称:</td>
                <td><input name="NewSupplier" type="text" value="@Model.Supplier"></td>
            </tr>
            <tr>
                <td>价格:</td>
                <td><input name="NewPrice" type="text" value="@Model.Price"></td>
            </tr>
            <tr>
                <td>库存数量:</td>
                <td><input name="NewStock" type="text" value="@Model.Stock"></td>
            </tr>
            <tr>
                <td>备注:</td>
                <td><input name="NewRemarks" type="text" value="@Model.Stock"></td>
            </tr>
        }

        <td><input type="button" value="保存" onclick="Save()"></td>
        <td><input type="button" value="取消" onclick="Return()"></td>
    </table>
    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/js/base.js"></script>
</body>